package cn.cs.mathgo.admin.modules.sys.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name="sc-admin",fallback = MenuFeignClient.MenuFeignClientImpl.class)
public interface MenuFeignClient {
    @RequestMapping(method = RequestMethod.GET ,value = "/sys/menu/getMenuByUser/{name}")
    R getLinkByUser(@PathVariable("name") String name);

        @Component
        class  MenuFeignClientImpl implements MenuFeignClient {

        @Override
        public R getLinkByUser(String name) {
            return R.error("已崩溃");
        }
    }
}
